package qshell

import "fmt"

type Context interface {
	Get(key string) any
	Set(key string, value any)
	Println(a ...any)
	Printf(format string, a ...any)
}

// Get 获取自定义数据
func (s *Shell) Get(key string) any {
	return s.info[key]
}

// Set 设置自定义数据
func (s *Shell) Set(key string, value any) {
	s.info[key] = value
}

func (s *Shell) Println(a ...any) {
	s.now.out = s.now.out + fmt.Sprintln(a...)
}

func (s *Shell) Printf(format string, a ...any) {
	s.now.out = s.now.out + fmt.Sprintf(format, a...)
}
